﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title>登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="../../Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../../Content/Icon.css" rel="stylesheet" />
    <link href="../../Content/Site.css" rel="stylesheet" />
</head>
<body style="margin-top: 15%">
    <form role="form" action='/Account/Login<%:(string.IsNullOrWhiteSpace(Request["ReturnUrl"]) ? string.Empty :  ("?ReturnUrl=" + Request["ReturnUrl"].Trim()))%>' method="post">
        <%: Html.AntiForgeryToken() %>
        <div style="width: 80%; margin-left: auto; margin-right: auto; border-top: 1px solid #3f4954;">
            <div class="text-center">
                <h3>
                    <img src="../../Content/images/mylogo.png" alt="Logo" /></h3>
            </div>
            <br />
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon" style="background: #28b779;">
                        <i class="cus-icon-user"></i>
                    </div>
                    <input class="form-control" type="text" placeholder="工号" id="UserName" name="UserName" onchange="autoCompleteLogin(this);" data-autocomplete-options='{data:function(sender,options){var obj=$.cookie();var result=obj.keys?obj.keys.filter(function(e){return e.indexOf("LOGIN:")==0;}):[];$.each(result,function(i,it){result[i]=it.replace("LOGIN:","");});return result;}}' />
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon" style="background: #28b779;">
                        <i class="cus-icon-key"></i>
                    </div>
                    <input class="form-control" type="password" placeholder="密码" id="Password" name="Password" />
                </div>
            </div>
            <div style="border-bottom: 1px solid #3f4954; height: 40px;">
                <div class="text-center">
                    <%: Html.ValidationSummary() %>
                </div>
            </div>
            <div style="height: 5px;"></div>
            <div class="row">
                <div class="col-xs-4">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" id="RememberMe" name="RememberMe" value="true" />记住密码
                        </label>
                    </div>
                </div>
                <div class="col-xs-8 text-right">
                    <button type="submit" class="btn btn-success">登录</button>&nbsp;<a href='<%:Url.Action("Forget") %>' class="btn btn-info">忘记密码?</a>
                </div>
            </div>
        </div>
    </form>
    <script src="../../Scripts/jquery-1.8.2.min.js"></script>
    <script src="../../Scripts/jquery.validate.js"></script>
    <script src="../../Content/bootstrap/ext/bootstrap.autocomplete.js"></script>
    <script src="../../Scripts/jquery.cookie.js"></script>
    <script src="../../Scripts/common.js"></script>
    <script type="text/javascript">
        activeAutoComplete($("#UserName")[0]);
        function autoCompleteLogin(sender) {
            if (!sender.value || !$.trim(sender.value)) return;
            if (sender._autocomplete && sender._autocomplete.source) {
                if (sender._autocomplete.source.contains(sender.value)) {
                    $("#RememberMe").attr("checked", true);
                    $("#Password").val($.cookie("LOGIN:" + sender.value) || "");
                }
            }
        }
    </script>
</body>
</html>
